home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / lzw4c.exe / LZW4C.DOC < prev    next >
Text File  |  1992-02-28  |  38KB  |  1,007 lines

  1.  
  2.  
  3.                           LZW Data Compression Library
  4.  
  5.                                 For the C Language
  6.  
  7.  
  8.                                     (LZW4C)
  9.  
  10.  
  11.  
  12.                                  USERS MANUAL
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                   Version 1.2
  19.  
  20.                                  March 1, 1993
  21.  
  22.  
  23.  
  24.  
  25.                         This software is provided as-is.
  26.                  There are no warranties, expressed or implied.
  27.  
  28.  
  29.  
  30.  
  31.                               Copyright (C) 1993
  32.                               All rights reserved
  33.  
  34.  
  35.  
  36.                               MarshallSoft Computing, Inc.
  37.                               Post Office Box 4543
  38.                               Huntsville AL 35815
  39.  
  40.                               205-881-4630 Voice / FAX
  41.                               205-880-9748 Support BBS
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.         LZW4C Users Manual                                     Page 1
  61.                               C O N T E N T S
  62.  
  63.  
  64.  
  65.  
  66.  
  67.          Chapter                                                   Page
  68.  
  69.          1.0 Introduction..............................................3
  70.              1.1 Distribution Files....................................3
  71.              1.2 Compiling the Library.................................4
  72.              1.3 User Support..........................................4
  73.              1.4 Installation..........................................5
  74.          2.0 The LZW Algorithm.........................................6
  75.              2.1 LZW Compression.......................................6
  76.              2.2 LZW Expansion.........................................7
  77.              2.3 LZW Implementation....................................7
  78.          3.0 Example Programs..........................................8
  79.              3.1 COMPRESS..............................................8
  80.              3.2 EXPAND................................................8
  81.              3.3 TEST_LZW..............................................9
  82.              3.4 MK_ARC................................................9
  83.              3.5 UN_ARC................................................9
  84.              3.6 SEE_ARC...............................................9
  85.          4.0 Reader & Writer Functions................................10
  86.          5.0 Library Functions........................................11
  87.              5.1 InitLZW..............................................11
  88.              5.2 TermLZW..............................................11
  89.              5.3 Compress.............................................12
  90.              5.4 Expand...............................................12
  91.          6.0 Error Codes..............................................13
  92.              6.1 EXPANSION_ERROR......................................13
  93.              6.2 CANNOT_ALLOCATE......................................13
  94.              6.3 INTERNAL_ERROR.......................................13
  95.              6.4 NOT_READY............................................13
  96.          7.0 Legal Issues.............................................14
  97.              7.1 Registration.........................................14
  98.              7.2 License..............................................15
  99.              7.3 Warranty.............................................15
  100.          8.0 Revision History.........................................15
  101.          9.0 Other MarshallSoft Computing Products for C..............16
  102.              9.1 The Personal Communications Library for C............16
  103.              9.2 The Personal Protocol Library for C..................16
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.         LZW4C Users Manual                                     Page 2
  121.          1.0 Introduction
  122.  
  123.  
  124.          LZW4C  consists  of a variable code size implementation of the LZW
  125.          (Lempel-Ziv-Welch) algorithm  for  compressing  and  decompressing
  126.          data.   LZW does particularly well on text files, achieving better
  127.          than a 50 % compression ratio for many files.
  128.  
  129.          The  LZW  algorithm  is  considered  to be one of the best general
  130.          purpose algorithms available today.  The  new  high  speed  modems
  131.          that  employ  on-the-fly  data  compression (such as MNP 5.0 & the
  132.          V.42 bis international standard) use the LZW  algorithm,  as  well
  133.          as such well known utility programs such as PKZIP.
  134.  
  135.          The  LZW4C  library  is  designed  to be used in a wide variety of
  136.          situations. Some of the possible uses include:
  137.  
  138.          1) Compression and expanding files on disk.
  139.          2) Compressing files "on the fly" before  sending  over  a  modem,
  140.             and then expanding on the receiving end.
  141.          3) Compression of data files used by your application program such
  142.             as help files, graphics screens, etc. The compressed data files
  143.             are then expanded as they are loaded by the application.
  144.  
  145.  
  146.          1.1 Distribution Files
  147.  
  148.          The distribution files are as follows:
  149.  
  150.           1) LZW4C_C.LIB -- COMPACT model library.
  151.           2) LZW4C_L.LIB -- LARGE model library.
  152.           3) LZW4C_L.MIX -- LARGE model library (MIX only).
  153.           4) LZW4C.DOC   -- This documentation file.
  154.           5) LZW4C.INV   -- Invoice file.
  155.           6) COMPRESS.C  -- Data compression example program.
  156.           7) EXPAND.C    -- Data expansion example program.
  157.           8) LZW4C.H     -- Library prototypes.
  158.           9) TEST_LZW.C  -- LZW test driver program.
  159.          10) MK_ARC.C    -- File archiving program.
  160.          11) UN_ARC.C    -- File un-archiving program.
  161.          12) SEE_ARC.C   -- Program to list archived files.
  162.          13) *._T_       -- Turbo C makefiles.
  163.          14) *._M_       -- Microsoft C makefiles.
  164.          15) X_*.BAT     -- MIX Power C batch file.
  165.          16) RW_IO.C     -- Reader/Writer I/O source file.
  166.          17) RW_IO.H     -- Reader/Writer prototype file.
  167.          18) DIR_IO.C    -- Directory I/O source file.
  168.          19) DIR_IO.H    -- Directory I/O prototype file.
  169.          20) SAYERROR.C  -- Displays text error messages.
  170.  
  171.          Registered users also receive:
  172.  
  173.           1) LZW4C.ASM   -- SOURCE CODE for the LZW4C libraries.
  174.           2) MAKE_C.BAT  -- Batch file to make LZW4C_C.LIB
  175.           3) MAKE_L.BAT  -- Batch file to make LZW4C_L.LIB
  176.           4) MAKE_XL.BAT -- Batch file to make LZW4C_L.MIX
  177.  
  178.  
  179.  
  180.         LZW4C Users Manual                                     Page 3
  181.          1.2 Compiling the Library
  182.  
  183.  
  184.          LZW4C  requires  rather  large  work  buffers  at  run time.  This
  185.          requires "far" data pointers which in turn  means  that  you  must
  186.          compile  using  either  the COMPACT memory model (with "near" code
  187.          pointers) or the LARGE memory model (with "far"  code  addresses).
  188.          There are, therefore, two memory model libraries provided:
  189.  
  190.          lzw4c_c.lib  -- Compact memory model library.
  191.          lzw4c_l.lib  -- Large memory model library.
  192.          lzw4c_l.mix  -- Large memory model library (MIX only).
  193.  
  194.          The registered user can re-compile the source code (source code is
  195.          provided in the registered version only) for the library using one
  196.          of the two provided batch files:
  197.  
  198.          make_c.bat  -- Creates lzw4c_c.lib.
  199.          make_l.bat  -- Creates lzw4c_l.lib.
  200.          make_xl.bat -- Create lzw4c_c.mix.
  201.  
  202.          Using  the  COMPACT memory model will result in a slightly smaller
  203.          and faster executable than using the LARGE memory model.  Be  sure
  204.          to compile all of your code for the correct memory model. Refer to
  205.          your compiler manual for more information on memory models.
  206.  
  207.  
  208.          1.3 User Support
  209.  
  210.          We  want you to be successful in developing your application using
  211.          our libraries! We depend on our customers to let us know what they
  212.          need in a library.  This means we are committed to  providing  the
  213.          best  libraries  that  we  can.   If  you  have any suggestions or
  214.          comments, please write to us or